import checks
import os

Import('*')

# get a list of source files
srcs = set()

for f in env.Glob('*.cc'):
	path, file = os.path.split(str(f) )
	srcs.add(file)

# remove the hrtime file since we don't want to compile it just yet
srcs.remove('hrtime.cc')

# compile them into object files
objs = env.Object(list(srcs), CPPPATH=['#include'])

merged_env = checks.merge_hrtime(env, hrtime_env)
objs.append(merged_env.Object('hrtime.cc') )

lib_name = 'nishe%s' % (libsuffix)
lib = env.StaticLibrary('#/lib/%s' % (lib_name), [objs] )
env.Alias('lib' + lib_name, lib)

Export('lib_name', 'lib')